package com.ykht.proj.coupon.Enum;

/**
 * @Author: lazyBoy
 * @Date: 2021/2/18 10:24
 */
public enum TaskTypeEnum {
	TASK_TYPE_0(0,"-"),
	TASK_TYPE_1(1,"满减券"),
	TASK_TYPE_2(2,"通用券");

	/**
	 * 数值
	 */
	private Integer value;
	/**
	 * 描述
	 */
	private String desc;

	private TaskTypeEnum(Integer value, String desc) {
		this.value = value;
		this.desc = desc;
	}


	/**
	 * 根据val值获取desc
	 * @param val 1、0
	 * @return
	 */
	public static String getDescByVal(Integer val) {
		TaskTypeEnum[] values = TaskTypeEnum.values();
		for (TaskTypeEnum oe : values) {
			if (oe.getValue().equals(val)) {
				return oe.getDesc();
			}
		}
		return null;
	}

	public Integer getValue() {
		return value;
	}

	public void setValue(Integer value) {
		this.value = value;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}
}
